SetGfxDriver 1:Graphics 90,19,8,2:SeedRnd MilliSecs() :SetBuffer FrontBuffer() 
p1=255

z1=Rand(0,p1): 
z2=Rand(0,p1): 
z3=Rand(0,p1): 
z4=Rand(0,p1):zx1=z1 + z2:zx2=z1 + z3:zx3=z3 + z4 
While Not KeyHit(1) 


For i1=0 To p1
For i2=0 To p1 
For i3=0 To p1 
For i4=0 To p1 

If KeyHit(1) Goto label1 
If((zx1=(i1 + i2)) And (zx2=(i1 + i3)) And (zx3=(i3 + i4))  ) w=w+1


If (i1i<>i1) Then 
Cls:Color 0,255,0:Text 1,1,"w: "+w,False ,False:Text 1,10," "+i1+" "+i2+" "+i3+" "+i4,False ,False
 Flip
EndIf
i1i=i1 
Next
Next
Next
Next

.label1
Exit

Wend 
